<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/static/common/base.jsp" %>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title></title>
	<script type="text/javascript" src="${ctxStatic}/layout/js/jquery-1.9.1.js"></script>
	<script type="text/javascript" src="${ctxStatic}/layout/js/main.js"></script>
	<script type="text/javascript" src="${ctxStatic}/layout/js/echarts.js"></script>
	<style type="text/css">
		div{height:400px;width:400px;float:left;}
	</style>
</head>
<body>
	<div type="line" url="${ctx}/layout/line"></div>
	<div type="bar" url="${ctx}/layout/bar"></div>
	<div type="pie" url="${ctx}/layout/pie"></div>
</body>
<script type="text/javascript">
$(function(){
	var eles=$("div[type]");
	for(var i=0;i<eles.length;i++){
		var ele=$(eles[i]);
		ele.attr("id",randomStr(8));
		var obj={id:ele.attr("id"),type:ele.attr("type"),url:ele.attr("url")}
		$.post(obj.url,{id:obj.id,type:obj.type,url:obj.url},function(data){
			builder.build(data);
		},"json")
	}
})
function randomStr(count){
	var tpl = "ABCDEDGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	var str="";
	for(var i=0;i<count;i++){
		str+=tpl.charAt(randomNum(51));
	}
	return str;
}
function randomNum(num){
	return Math.floor(Math.random()*num);
}
</script>
</html>